package com.zhengbing.tj.common;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

/**
 * 雪花算法ID生成器
 *
 * @author zhengbing
 * @date 2025-07-07
 */
public class IdGenerator {
    private static final Snowflake snowflake = IdUtil.getSnowflake(1, 1);

    /**
     * 生成唯一ID
     */
    public static long nextId() {
        return snowflake.nextId();
    }

    /**
     * 生成唯一ID字符串
     */
    public static String nextIdStr() {
        return snowflake.nextIdStr();
    }
}